package com.example.springboot.modules.test.entity;

import com.example.springboot.modules.common.entity.AbstractEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.naming.Name;
import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "test_student")
public class Student extends AbstractEntity {
    private String studentName;
    @OneToOne(targetEntity=Card.class,cascade= CascadeType.ALL)
    @JoinColumn(name="card_id",unique = true)
    private Card studentCard;
    @ManyToMany(mappedBy = "students",cascade = CascadeType.ALL)
    @JsonIgnore
    private List<Clazz> clazzes;

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public Card getStudentCard() {
        return studentCard;
    }

    public void setStudentCard(Card studentCard) {
        this.studentCard = studentCard;
    }

    public List<Clazz> getClazzes() {
        return clazzes;
    }

    public void setClazzes(List<Clazz> clazzes) {
        this.clazzes = clazzes;
    }
}
